<template>
  <panel>
    <ymy-lookup
      ref="test"
      :url="url"
      :sellabel="label"
      :selkey="key"
      v-model="value"
      :config="config"
      @change="change"
      :disabled="false"
      :filter="filter"></ymy-lookup>

    <el-button @click="reload" size="small">reload</el-button>
  </panel>
</template>

<script>

  export default {
    data() {
      return {
        url: '/gi-paas-sd-admindivisiontypesvc/api/object/adminDivisionType/lookup',
        label: 'adminDivisionTypeCode',
        key: 'id',
        value: 'ee479a2b5fe6484f9872ebed69c4c3cb',
        config: {
          condition: {},
          number: 0,
          relation: 'and',
          size: 2,
          sortDirection: 'ASC',
          sortProperties: [],
        }
      };
    },
    methods: {
      change: function(key, item, obj) {
        console.log(key);
      },
      click:function(){
        this.options.push({value:'3',label:'3'})
      },
      filter(item){
        return true;
      },
      reload() {
        this.$refs.test.reload(
          {
            condition: {'countryCode': 'CN'},
            number: 0,
            relation: 'and',
            size: 5,
            sortDirection: 'ASC',
            sortProperties: [],
          },
        );
      },

    },
  };
</script>

<style>

</style>
